import {request} from "../../request/index.js"
Page({
  data:{
    myOrder:'',
  },
  async onLoad(){
     const res=await request({url:"/checkOrder",method:"POST"});
     console.log(res.data.results);
     let myOrder=res.data.results;
    //  时间升序
    myOrder.forEach(item => {
      item.dueTime=Date.parse(item.order_time)  
     });

     myOrder.sort(function(a,b){
       return b.dueTime-a.dueTime
      })
     this.setData({
      myOrder:myOrder
     })
  }
})